/*
 * network.h
 * Michael du Breuil
 *
 * network structs and headers
 */

#pragma once

#include <stdint.h>

#define NET_VERSION       0.0

#define NET_PORT          666

#define MSG_STATUS        1
#define MSG_CAM_SETTINGS  2
#define MSG_FILE_SETTINGS 3
#define MSG_SRIC_SETTINGS 4
#define MSG_IMG_TRANSF    5

#define MAX_CLIENTS 32

typedef struct cam_settings_s {
  char url[1024];
  uint32_t rate;
  uint32_t flags;
} cam_settings_t;

typedef struct ftp_settings_s {
  char destination[128];
  unsigned int flags;
} ftp_settings_t;

typedef struct image_s {
  char fileName[1024];
  char gpsData[32];
  uint32_t id;
} image_t;

typedef struct status_s {
  uint32_t images_taken;
  uint32_t images_pushed;
} status_t;

typedef struct message_s {
  char type;
  union payload_u {
    cam_settings_t cam_settings;
    ftp_settings_t ftp_settings;
    image_t        image;
    status_t       status;
  } payload;
} message_t;

